// MenuWndSubclass.cpp: implementation of the CMenuWndSubclass class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "skin.h"
#include "MenuWndSubclass.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMenuWndSubclass::CMenuWndSubclass()
{

}

CMenuWndSubclass::~CMenuWndSubclass()
{

}

LRESULT CMenuWndSubclass::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
{
	switch (msg){
		case WM_NCPAINT:
			CWndSubclass::WindowProc(msg, wp, lp);
			OnNcPaint();
			return 0;
	}
	return CWndSubclass::WindowProc(msg, wp, lp);
}

void CMenuWndSubclass::OnNcPaint()
{
	CWindowDC dcWin(m_pWndHooked);

	CRect rcWin;
	m_pWndHooked->GetWindowRect(&rcWin);
	rcWin -= rcWin.TopLeft();

	CRect rcLeftFrm(rcWin);
	rcLeftFrm.right = rcLeftFrm.left + 2;
	dcWin.Draw3dRect(&rcLeftFrm, RGB(160, 180, 200), RGB(100, 120, 140));

	CRect rcTopFrm(rcWin);
	rcTopFrm.bottom = rcTopFrm.top + 2;
	dcWin.Draw3dRect(&rcTopFrm, RGB(160, 180, 200), RGB(100, 120, 140));

	CRect rcRightFrm(rcWin);
	rcRightFrm.left = rcRightFrm.right - 2;
	dcWin.Draw3dRect(&rcRightFrm, RGB(100, 120, 140), RGB(160, 180, 200));

	CRect rcBottomFrm(rcWin);
	rcBottomFrm.top = rcBottomFrm.bottom - 2;
	dcWin.Draw3dRect(&rcBottomFrm, RGB(100, 120, 140), RGB(160, 180, 200));

	CRect rcFrmInside(rcWin);
	rcFrmInside.DeflateRect(2, 2, 2, 2);
	CBrush brush(RGB(160, 180, 200));
	dcWin.FrameRect(&rcFrmInside, &brush);
}
